#ifndef __BUSINESSTASK_HPP__
#define __BUSINESSTASK_HPP__
#include "Message.hpp"
#include "EventLoop.hpp"
#include "shadow.h"

namespace wd{
class UserLoginSection1{
public:
    UserLoginSection1(wd::Packet & packet, wd::TcpConnectionptr tcpconn);

    void process();

    void get_setting(string & setting, char * passwd);

private:
    Packet _packet;
    TcpConnectionptr _tcpconn;
};

class UserLoginSection2{
public:
    UserLoginSection2(wd::Packet & packet, wd::TcpConnectionptr tcpconn);

    void process();

private:
    Packet _packet;
    wd::TcpConnectionptr _tcpconn;
};


class UserRegisterSection1{
public:

    UserRegisterSection1(Packet & packet, TcpConnectionptr tcpconn);
    
    char * GenRandomSring(int length);

    void process();

private:
    Packet _packet;
    wd::TcpConnectionptr _tcpconn;

};

class UserRegisterSection2{
public:
    
    UserRegisterSection2(Packet & packet, TcpConnectionptr tcpconn);

    void process();
    void get_setting(string & setting, char * passwd);
    bool is_crypt_valid(const char * passwd);

private:
    Packet _packet;
    wd::TcpConnectionptr _tcpconn;

};


}

#endif // __BUSINESSTASK_HPP__

